#ifndef KGRAPHICSSCENE_H
#define KGRAPHICSSCENE_H

#include <QGraphicsScene>
#include "idraw.h"
#include "kline.h"
#include "krect.h"
#include "DrawType.h"

// 场景
class KGraphicsScene
    : public QGraphicsScene
{
    Q_OBJECT
public:
    explicit KGraphicsScene(QObject *parent = 0);

public slots:
        inline void setCurrentShape(DrawTool s) //设置当前绘制类型
        {
                if(s != m_currDrawType) {
                        m_currDrawType = s;
                }
        }

protected:
        void mousePressEvent(QGraphicsSceneMouseEvent *event);
        void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
        void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

private:
        DrawTool m_currDrawType;    //当前绘制类型
        IDraw *m_currDrawItem;      //当前绘制对象
        bool perm;                  //是否正在绘制图元
};

#endif // KGRAPHICSSCENE_H
